package oms.service;

import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import oms.dao.UserDAO;
import oms.entities.User;

@Service
public class UserServiceImpl implements UserService {
	
		@Autowired
		private UserDAO userDAO;
		
		@Transactional
		public void createUser(User user) {

				userDAO.createUser(user);
		}
		
		@Transactional
		public void updateUser(Long userId) {
	
				userDAO.updateUser(userId);
		}
		
		@Transactional
		public User getUserById(Long userId) {
		
				return userDAO.getUserById(userId);
		}
		
		@Transactional
		public void deleteUser(Long userId) {
			
				userDAO.deleteUser(userId);
		}
		
		@Transactional
		public List<User> usersList() {
		
				return userDAO.usersList();
		}
}